package main

import "fmt"

//数组交集并集
func main() {
	var a = []string{"a", "b", "c", "d", "e"}
	var b = []string{"f", "c", "e", "g"}
	// {c,e}
	var minus = make(map[int]string)
	var plus = make(map[int]string)
	var common = make(map[string]int)
	var common2 = make(map[string]int)
	for k, v := range a {
		for k2, v2 := range b {
			if v2 == v {
				common[v] = k
				common2[v2] = k2
				fmt.Println()
				continue
			}
			//break
		}
	}
LOOP:
	for k, v := range b {
		for k2, v2 := range common2 {
			fmt.Println(k, k2, v2)
			if k == v2 {
				continue LOOP
			}
		}
		plus[k] = v
	}
LOOP2:
	for k, v := range a {
		for k2, v2 := range common {
			fmt.Println(k, k2, v2)
			if k == v2 {
				continue LOOP2
			}
		}
		minus[k] = v
	}
	fmt.Println(common)
	fmt.Println(common2)
	fmt.Println(plus)
	fmt.Println(minus)
}
